disconnectSession  <script type="text/javascript" charset="utf-8">
	var openTokData;
	var session;
	var archive;
		
	function archiveCreateHandler(event) {
        archive = event.archives[0];
	}
       
	function sessionConnectedHandler(event){
			 var publishProps = {height:240, width:320};
		      publisher = TB.initPublisher(openTokData.apiKey, 'publisherDiv');
		      // Send my stream to the session
		      session.publish(publisher);
		      $('#startBtn').text("Stop Teaching");
			  $("#startBtn").attr('onclick','disconnectSession();');
			 changeStatusBtnToStartRecording();
			 subscribeToStreams(event.streams);
 	}

	
	function changeStatusBtnToStartRecording(){
		$("#recordBtn").attr("class","btn");
	      $('#recordBtn').text('Start Recording');
	      $("#recordBtn").attr('onclick','startRecording();');
	      $("#recordBtn").attr("href", '#');

	}
	
	function changeStatusToStopRecording(){
		  $('#recordBtn').text('Stop Recording');
	      $("#recordBtn").attr('onclick','stopRecording();');
	      $("#recordBtn").attr("href", '#');		
	}
	function stopRecording(){
		session.stopRecording(archive);
		changeStatusBtnToStartRecording()
	}
	
	function recordingInProgressHandler(event) {
	    alert("There is a recording in progress already.");
	}

	function recordingStartedHandler(event) {
	    alert("The session is being recorded.");
	}
	
	function disconnectSession(){
		session.disconnect();
	}
	function subscribeToStreams(streams) {
	      for (var i = 0; i < streams.length; i++) {
	        // Make sure we don't subscribe to ourself
	        if (streams[i].connection.connectionId == session.connection.connectionId) {
	          return;
	        }
	        var div = document.createElement('div');
	        div.setAttribute('id', 'stream' + streams[i].streamId);
	        document.getElementById('subscriberDiv').appendChild(div);

	        // Subscribe to the stream
	        var subscribeProps = {height:240, width:320};
	        session.subscribe(streams[i], div.id);
	      }
	    }
	function streamCreatedHandler(event) {
	      // Subscribe to any new streams that are created
	      subscribeToStreams(event.streams);
	    }
	function exceptionHandler(event){
		 TB.log(event.message);
		alert('in exception event');
	}
</script>
	
	  <div class="row">
        <div class="span4">
          <h2>My Session</h2>
          <a style="float:right;" class="btn btn-primary btn-large stopEvent">Stop Session</a>
          <a id="recordBtn"></a> 
        </div>
		</div>
		
<div id="publisherDiv">
</div>    
<div id="subscriberDiv">
</div>
